﻿
@{
    Layout = "~/Views/Shared/_UserLayout.cshtml";
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Set</title>
    <link href="~/Content/layui.css" rel="stylesheet" />
    <link href="~/Content/global.css" rel="stylesheet" />
    <script src="~/Scripts/jquery-3.4.1.min.js"></script>
</head>
<body>
    <div class="layui-container fly-marginTop fly-user-main">
        <ul class="layui-nav layui-nav-tree layui-inline" lay-filter="user">
            <li class="layui-nav-item">
                <a href="@Url.Action("Home","User")">
                    <i class="layui-icon">&#xe609;</i>
                    我的主页
                </a>
            </li>
            <li class="layui-nav-item">
                <a href="@Url.Action("Index","User")">
                    <i class="layui-icon">&#xe612;</i>
                    用户中心
                </a>
            </li>
            <li class="layui-nav-item layui-this">
                <a href="@Url.Action("Set","User")">
                    <i class="layui-icon">&#xe620;</i>
                    基本设置
                </a>
            </li>
        </ul>

        <div class="site-tree-mobile layui-hide">
            <i class="layui-icon">&#xe602;</i>
        </div>
        <div class="site-mobile-shade"></div>

        <div class="site-tree-mobile layui-hide">
            <i class="layui-icon">&#xe602;</i>
        </div>
        <div class="site-mobile-shade"></div>


        <div class="fly-panel fly-panel-user" pad20>
            <div class="layui-tab layui-tab-brief" lay-filter="user">
                <ul class="layui-tab-title" id="LAY_mine">
                    <li class="layui-this" lay-id="info">我的资料</li>
                    <li lay-id="avatar">头像</li>
                    <li lay-id="pass">密码</li>
                </ul>
                <div class="layui-tab-content" style="padding: 20px 0;">
                    <div class="layui-form layui-form-pane layui-tab-item layui-show">
                        <form method="post" action="@Url.Action("Update","User")">
                            <div class="layui-form-item">
                                <label for="L_email" class="layui-form-label">邮箱</label>
                                <div class="layui-input-inline">
                                    <input type="text" id="L_email" name="Email" lay-verify="email" autocomplete="off" value="" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label for="L_username" class="layui-form-label">昵称</label>
                                <div class="layui-input-inline">
                                    <input type="text" id="L_username" name="Name" lay-verify="required" autocomplete="off" value="" class="layui-input">
                                </div>
                                <div class="layui-inline">
                                    <div class="layui-input-inline">
                                        <input type="radio" name="Gender" value="0" checked title="男">
                                        <input type="radio" name="Gender" value="1" title="女">
                                    </div>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label for="L_city" class="layui-form-label">城市</label>
                                <div class="layui-input-inline">
                                    <input type="text" id="L_city" name="Address" autocomplete="off" value="" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item layui-form-text">
                                <label for="L_sign" class="layui-form-label">签名</label>
                                <div class="layui-input-block">
                                    <textarea placeholder="随便写些什么刷下存在感" id="L_sign" name="Signature" autocomplete="off" class="layui-textarea" style="height: 80px;"></textarea>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <input type="submit" class="layui-btn" value="修改"></input>
                            </div>
                        </form>
                    </div>


                    <div class="layui-form layui-form-pane layui-tab-item">
                        <div class="layui-form-item">
                            <div class="avatar-add">
                                <p>建议尺寸168*168，支持jpg、png、gif，最大不能超过50KB</p>
                                <button type="button" class="layui-btn upload-img" id="upload_head_img">
                                    <i class="layui-icon">&#xe67c;</i>上传头像
                                </button>
                                @using (Html.BeginForm("UploadImage", "User", FormMethod.Post,
                                    new { enctype = "multipart/form-data" }))
                                {
                                    <input type="file" name="head_photo" id="upload_file" value="上传头像" hidden/>
                                    <input type="submit" value="点我上传" id="img_submit" hidden/>
                                }
                                <script>
                                    $('#upload_head_img').click(function () {
                                        $('#upload_file').click();
                                    });
                                    $('#upload_file').change(function () {
                                        
                                        $('#img_submit').click();
                                    });
                                </script>
                                <img src="@Session["head_img"]">
                                <span class="loading"></span>
                            </div>
                        </div>
                    </div>

                    <div class="layui-form layui-form-pane layui-tab-item">
                        <form action="@Url.Action("ChangePwd","User")" method="post">
                            <div class="layui-form-item">
                                <label for="L_nowpass" class="layui-form-label">当前密码</label>
                                <div class="layui-input-inline">
                                    <input type="password" id="L_nowpass" name="oldPwd" lay-verify="required" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label for="L_pass" class="layui-form-label">新密码</label>
                                <div class="layui-input-inline">
                                    <input type="password" id="L_pass" name="newPwd" lay-verify="required" autocomplete="off" class="layui-input">
                                </div>
                                <div class="layui-form-mid layui-word-aux">6到16个字符</div>
                            </div>
                            <div class="layui-form-item">
                                <input type="submit" class="layui-btn" value="修改密码"/>
                            </div>
                        </form>
                    </div>
                </div>

            </div>
        </div>
    </div>
</body>
</html>